/**
 * 
 */
package com.aceitunaproject.webclient.client;


import java.util.List;


import com.aceitunaproject.shared.gamelement.Unit;
import com.aceitunaproject.shared.map.MapTile;
import com.aceitunaproject.webclient.server.LoginFailedException;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * @author Federico Bergstein
 * 
 */
@RemoteServiceRelativePath("AceitunaService")
public interface AceitunaService extends RemoteService {

	/**
	 * Login to the server
	 * @throws LoginFailedException 
	 * @throws Exception 
	 */
	public String login(String userName, String password) throws  Exception;
	
	
	/**
	 * Requests the current map
	 * @throws Exception 
	 */
	public List<MapTile> getMap(String clientId) throws Exception;

	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static AceitunaServiceAsync instance;

		public static AceitunaServiceAsync getInstance() {
			if (instance == null) {
				instance = GWT.create(AceitunaService.class);
			}
			return instance;
		}
	}




	void MoveUnit(String clientId, long unitID, int x, int y);



	void BuildSettlement(String clientId, Long unitID, String settlementName,
			int x, int y);



}
